/**
 * Created by Administrator on 2018/1/24.
 */
let schedule = require('node-schedule');
let modeA = require('./modeA.js');

let cron = module.exports;

cron.init = function () {
    cron.instantMode();
};

cron.instantMode = function () {
    //schedule.scheduleJob('* * * * * *', function () {
    //    modeA.getInstance().add();
    //});
    modeA.getInstance().start();
    schedule.scheduleJob('0 0 * * * *', function () {
        modeA.getInstance().start();
    });
    schedule.scheduleJob('0 30 * * * *', function () {
        modeA.getInstance().stop();
    });
    schedule.scheduleJob('* * * * * *', function () {
        modeA.getInstance().cron();
    });
};